package main1.q_IteratorModel;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by newtranx_011 on 2017/9/26.
 */
public class Main {
    public static void main(String[] args) {
        test();
        System.out.println("------------------------");
        test1();
    }

    public static void test() {
        Collection collection = new MyCollection();
        Iterator it = collection.iterator();

        while(it.hasNext()){
            System.out.println(it.next());
        }

    }

    public static void test1() {
        List<String> list = new ArrayList<String>();
        for (int i=0; i<4; i++){
            list.add("a");
        }

        java.util.Iterator iterator = list.iterator();
        while (iterator.hasNext()){
            System.out.println(String.valueOf(iterator.next()));
        }

    }


}
